/**
 * Created by Liujx on 2017-10-18 11:28:42
 */
var sliderWidth = 96; // 需要设置slider的宽度，用于计算中间位置
var user_nick = wx.getStorageSync('user_nickname');
var user_head = wx.getStorageSync('user_head');
const myRecordUrl = require('../../../config').myRecordUrl;

Page({
    data: {
        tabs: ["朗读过的文章"],
        activeIndex: 0,
        sliderOffset: 0,
        sliderLeft: 0
    },
    onLoad: function (options) {
      var that = this;
      wx.request({
        url: myRecordUrl,
        method: 'GET',
        data: {
          user_nick: user_nick
        },
        header: {
          'content-type': 'application/x-www-form-urlencoded' // 默认值
        },
        success: function (res) {
          //console.log(user_nick)
          console.log(res)
          that.setData({
            comments: res.data.data
          })
        }
      })
    },
    tabClick: function (e) {
        this.setData({
            sliderOffset: e.currentTarget.offsetLeft,
            activeIndex: e.currentTarget.id
        });
    }
});